﻿@using Website.CRUDServices
@using Location = Website.Models.Domain.Location
@{
    this.ViewBag.Title = "Søgning - Nyhedsinformation";
    this.Layout = "~/Views/_Shared/_Layout.cshtml";
    List<Project> projects = this.ViewData["Projects"] as List<Project> ?? new List<Project>();
    List<NewsInformationType> types = this.ViewData["Types"] as List<NewsInformationType> ?? new List<NewsInformationType>();
    List<Fund> funds = this.ViewData["Funds"] as List<Fund> ?? new List<Fund>();
}

<h2>@ViewBag.Title</h2>

<script>
    $(function() {
        $('#Funds').multiSelect();
    });
</script>

@using (this.Html.BeginForm("NewsInformationSearchResult", "Reports"))
{
    @* Tilføjer søge-partial *@
    @Html.Partial("~/Views/Reports/_SearchDefaultFields.cshtml", projects)

    <div class="formBullet">Type:</div>
    <div class="formEntry">
        <select name="Type" id="Type">
            <option value="@Guid.Empty.ToString()" selected="selected"></option>
            @foreach (NewsInformationType nit in types.OrderBy(x => x.Name))
            {
                <option value="@nit.ID">@nit.Name</option>
            }
        </select>
    </div>

    <div class="formBullet">Puljer og fonde som skal indgå:</div>
    <div class="formEntry">
        <select name="Funds" id="Funds" multiple="multiple">
            @foreach (Fund fund in funds)
            {
                <option value="@fund.ID">@fund.Name</option>
            }
        </select>
    </div>
    
    <div class="buttonHolder">
        <input type="submit" value="Søg" /></div>
}